<template>
	<view class="page">
		<view class="header" :style="{ paddingTop: statusBarHeight + 'px' }">
			<text class="title">朋友</text>
		</view>
		<view class="content">
			<view class="empty-state">
				<uni-icons type="person" size="60" color="#666"></uni-icons>
				<text class="empty-text">暂无朋友动态</text>
			</view>
		</view>
		<BottomTabBar active="friends" :badge="0" @change="onTabChange" @publish="onPublish" />
	</view>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import BottomTabBar from '@/components/BottomTabBar.vue'

const statusBarHeight = ref(0)
onMounted(() => {
	// #ifdef APP-PLUS || MP
	statusBarHeight.value = uni.getSystemInfoSync().statusBarHeight || 0
	// #endif
})

function onTabChange(key) {
	if (key === 'home') {
		uni.reLaunch({ url: '/pages/index/index' })
	} else if (key === 'friends') {
		// 当前页面，无需切换
	} else if (key === 'message') {
		uni.reLaunch({ url: '/pages/message/index' })
	} else if (key === 'me') {
		uni.reLaunch({ url: '/pages/me/index' })
	}
}

function onPublish() {
	uni.navigateTo({ 
		url: '/pages/publish/record' 
	})
}
</script>

<style scoped>
.page {
	width: 100vw;
	height: 100vh;
	background: #000;
	display: flex;
	flex-direction: column;
}

.header {
	padding: 20rpx 30rpx;
	background: rgba(0, 0, 0, 0.8);
}

.title {
	font-size: 36rpx;
	font-weight: 600;
	color: #fff;
}

.content {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20rpx;
}

.empty-text {
	font-size: 28rpx;
	color: #666;
}
</style>

